import { library } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { fas } from '@fortawesome/free-solid-svg-icons'
library.add(fas)

import './styles/index.scss'

import Icon from '@/components/Icon'
import Button from '@/components/Button'
import Card from '@/components/Card'
import Dialog from '@/components/Dialog'
import Pager from '@/components/Pager'
import Collapse from '@/components/Collapse'
import CollapseItem from '@/components/Collapse/CollapseItemIndex'
import Tooltip from '@/components/Tooltip'
import Dropdown from '@/components/Dropdown'

const componentArr = [Icon, Button, Card, Dialog, Pager, Collapse, CollapseItem, Tooltip, Dropdown]

const install = (app) => {
  componentArr.forEach(item => {
    app.component(item.name, item)
  })
  app.component('font-awesome-icon', FontAwesomeIcon)
}

export { install, Icon, Button, Card, Dialog, Pager, Collapse, CollapseItem, Tooltip, Dropdown }

export default {
  install
}
